package cn.gailvlun.gll.net.apartment.room;

import android.support.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import cn.gailvlun.gll.net.Optional;
import cn.gailvlun.gll.net.QueryParam;


public class GetRoomListReq {
    private static final String next = "next";
    private static final String previous = "previous";

    @StringDef(value = {next, previous})
    @Retention(RetentionPolicy.RUNTIME)
    public @interface Direction {}

    @Direction
    private String direction;   
    private Integer id; 
    private RoomType type = RoomType.home; 
    @Optional
    private RoomTag room_tag; 

    @Direction
    public String getDirection() {
        return direction;
    }

    public void setDirection(@Direction String direction) {
        this.direction = direction;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public RoomType getType() {
        return type;
    }

    public void setType(RoomType type) {
        this.type = type;
    }

    public RoomTag getRoom_tag() {
        return room_tag;
    }

    public void setRoom_tag(RoomTag room_tag) {
        this.room_tag = room_tag;
    }

    public void resetPage() {
        direction = null;
        id = null;
    }

    public void nextPage(int lastId) {
        direction = next;
        id = lastId;
    }

    public void prePage(int firstId) {
        direction = previous;
        id = firstId;
    }
}
